package aiowang.springframe.auto;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import javax.annotation.Resource;

/**
 * @author aiowang
 * @description:
 * @date 2021/8/13 23:09
 */
public class UserAuto {
   // @Autowired
    private Cat cat;

    @Autowired
    @Qualifier(value = "dog2")
    private Dog dog;

    //如果允许对象为null，设置required = false,默认为true
    @Resource(name = "cat2")
    private Cat cat2;

    public void setCat2(Cat cat2) {
        this.cat2 = cat2;
    }

    public Cat getCat2() {
        return cat2;
    }

    private String str;

    public Cat getCat() {
        return cat;
    }

    public void setCat(Cat cat) {
        this.cat = cat;
    }

    public Dog getDog() {
        return dog;
    }

    public void setDog(Dog dog) {
        this.dog = dog;
    }

    public String getStr() {
        return str;
    }

    public void setStr(String str) {
        this.str = str;
    }
}
